﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true"
    CodeBehind="ad_list.aspx.cs" Inherits="LinkCard.AdminCP.Adv.ad_list" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script>
        
        function setValue(page) {
            location.href = 'ad_list.aspx?page=' + page;
        }
        function confirmAction() {
            if (confirm('Bạn thực sự muốn xoá quảng cáo???')) {
                // you clicked the OK button.
                // you can allow the form to post the data.
                return true;
            }
            else {
                // you clicked the Cancel button.
                // you can disallow the form submission.
                return false;
            }
        }
    </script>
    <section id="content">
  <section class="container_12 clearfix">
    <section id="main" class="grid_12">
      <article>
        <div class="h1">Danh sách quảng cáo</div>
     
          <div class="box search" style="display:none;">
       
          <label >Tìm kiếm:</label>
          <input  type="text" onfocus="this.value = '';" onblur="if (this.value == '') { this.value='Tiêu đề'; }"  value="Tiêu đề" size="40" id="txtSearch"  runat="server" />
          
          
          <asp:DropDownList ID="CategoryID" runat="server" >
                            </asp:DropDownList>
          
          <%--<input type="text" size="20"  onfocus="this.value = '';" onblur="if (this.value == '') { this.value='Từ ngày'; }" value="Từ ngày"  maxlength="10"  id="PostFrom"  class="hasDatepicker" name="PostFrom" runat="server" />
          <input  type="text" onfocus="this.value = '';" onblur="if (this.value == '') { this.value='Đến ngày'; }" value="Đến ngày" size="20" id="PostTo" name="PostTo"  class="hasDatepicker" runat="server"  maxlength="10" />--%>
          <input type="text" id="PostFrom" runat="server" value="Từ ngày" onfocus="this.value = '';" onblur="if (this.value == '') { this.value='Từ ngày'; }">
          <input type="text" id="PostTo" runat="server" value="Đến ngày" onfocus="this.value = '';" onblur="if (this.value == '') { this.value='Đến ngày'; }">
          
          <asp:Button ID="btnSearch" class="button small" Style="width: 60px;"
                                runat="server" Text="Tìm kiếm" onclick="btnSearch_Click"  />
        
      </div>
          <table id="table1" class="gtable sortable" >
            <thead>
              <tr>
                <th><input type="checkbox" class="checkall" /></th>
                
                <th>Hiển thị</th>
                
                <th>Tiêu đề</th>
                <th>File</th>
                <th>Vị trí</th>
                <th>Ngày đăng</th>
                
                <th></th>
              </tr>
            </thead>
            <tbody>
            <asp:Repeater ID="msgList" runat="server" OnItemDataBound="msgList_ItemDataBound">
                        <ItemTemplate>
                            <tr>
                                <td >
                                    <input type="checkbox" id="chkDelete" runat="server" />
                                </td>
                                <td>
                                    <a href="ad_active.aspx?id=<%# DataBinder.Eval(Container.DataItem, "adID")%>"><asp:Image ID="IconCheck" runat="server" /></a>
                                </td>
                                
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "AdTitle")%>
                                </td>
                                <td><asp:Literal ID="ltrText" runat="server"></asp:Literal></td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "AdPosition")%>
                                </td>
                               <td>
                                    <%# LinkCard.Utils.ConvertUtility.ToDateTime( DataBinder.Eval(Container.DataItem, "AdPostDate")).ToString("dd/MM/yyyy")%>
                                </td>
                                <td><a href="ad_edit.aspx?adID=<%# DataBinder.Eval(Container.DataItem, "adID")%>" title="Sửa"><img src="../Template/images/icons/edit.png" alt="Sửa" /></a></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <tr id="msgNoData" runat="server">
                        <td colspan="6" align="center">
                            Không có quảng cáo nào!
                        </td>
                    </tr>
              
              
            </tbody>
          </table>
          <div class="tablefooter clearfix">
            <div class="actions">
              <select id="ActionOption" runat="server">
                <option value="0">Thao tác</option>
                <option value="1">Xóa</option>
              </select>
              
              <asp:Button ID="btnDelete" 
                                runat="server" Text="Thực hiện"  class="button small" 
                    style="width:80px;" onclick="btnDelete_Click" OnClientClick="javascript:return confirmAction();" />
            </div>
            <div class="pagination" id="divPager" runat="server">
              <!--<a href="#">Prev</a>-->
              <%--<a href="#" class="current">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> <a href="#">5</a> ... <a href="#">78</a> <a href="#">Trang sau</a>--%>
              <asp:Literal ID="PagerShow" runat="server"></asp:Literal>
               </div>
          </div>
        
      </article>
    </section>
    
  </section>
</section>
</asp:Content>
